/**
 * https://leetcode.cn/problems/count-ways-to-build-good-strings/description/
 * 2466. 统计构造好字符串的方案数
 * medium, 赖德檀 2024.09.09
 * 动态规划
 */
 class Solution {
public:
    int countGoodStrings(int low, int high, int zero, int one) {
        vector<int>dp(100010,0);
        dp[0]=1;
        for(int i=1;i<=high;i++)
        {
            if(i>=zero)
             dp[i]=(long long)(dp[i]+dp[i-zero])%1000000007;
            if(i>=one)
             dp[i]=(long long)(dp[i]+dp[i-one])%1000000007;
        }
        int sum=0;
        for(int i=low;i<=high;i++)
         sum=(sum+dp[i])%1000000007;
        return sum;
    }
};